package com.util.character;

/**
 * 字符串函数 substring() 函数来删除字符串中的一个字符，我们将功能封装在 removeCharAt 函数中
 */
public class RemoveCharAt {
    public static void main(String[] args) {
        String str = "To be both a speaker of words and a doer of deeds";
        System.out.println(removeCharAt(str, 3));
    }

    public static String removeCharAt(String str, int pos) {
        return str.substring(0, pos) + str.substring(pos + 1);
    }
}
